package zuo.from0516.real;

import java.util.HashMap;
import java.util.Scanner;

public class Code01_day0912 {
    public static void main(String[] args) {
        int[] nums = new int[]{2,3,2 ,5, 5, 1, 4};
//        System.out.println(getResult(nums));;
//        getResult3("a:3,b:5,c:2@a:1,b:2");
        Scanner sc = new Scanner(System.in);

        int[] num = getResult1();


    }

    public static int[] getResult1(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sum = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = sc.nextInt();
        }
        int ans[] = new int[n];
        int total = 0;
        for (int num : nums) {
            total += num;
        }
        if (total < sum) {
            return ans;
        }
        int[] removeNum = new int[n];
        int maxCapacity = sum / n;
        for (int i = 0; i < n; i++) {
            if(nums[i] > maxCapacity){
                removeNum[i] = nums[i] - maxCapacity;
            }else{
                removeNum[i] = 0;
            }
        }
        return removeNum;
    }
    public static int getResult(int[] area){
        if(area.length == 0){
            return 0;
        }
        int res = 0;
        for(int i=1;i<area.length;i++){
            int sum = area[i]+area[i-1];
            if(sum < 100){
                res += 100-sum;
            }
        }

        return res;
    }


    public static void getResult3(String letters) {

        String[] strArr = letters.split("@");
        if (strArr.length < 2) {
            System.out.println(strArr[0]);
            return;
        }
        HashMap<Character, Integer> hashMap = new HashMap<>();
        String str1 = strArr[1];

        for (String str : str1.split(",")) {
            String numS = String.valueOf(str.charAt(str.length() - 1));
            Integer num = Integer.parseInt(numS);
            hashMap.put(str.charAt(0), num);
        }
        String[] strs = strArr[0].split(",");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strs.length; i++) {
            String str = strs[i];
            Integer num = hashMap.getOrDefault(str.charAt(0), 0);
            int allNum = Integer.parseInt(String.valueOf(str.charAt(str.length() - 1)));
            if (allNum - num > 0) {
                sb.append(str.charAt(0)).append(":").append(allNum - num);
                if (i != strs.length - 1) {
                    sb.append(",");
                }
            }
        }
        if (sb.charAt(sb.length() - 1) == ',') {
            sb.deleteCharAt(sb.length() - 1);
        }

        System.out.println(sb.toString());
    }
}
